package com.hisan.freeride.home.fragment;

import com.hisan.freeride.R;
import com.hisan.freeride.common.base.BaseFragment;
import com.hisan.freeride.common.utils.CollectionUtils;
import com.hisan.freeride.common.utils.utils.TokenUtils;
import com.hisan.freeride.databinding.StrokeBinding;
import com.hisan.freeride.home.activity.LoginActivity;
import com.hisan.freeride.home.activity.ReleaseActivity;
import com.hisan.freeride.home.activity.ReserveActivity;


/**
 * 创建时间 : 2017/6/6
 * 创建人：yangyingqi
 * 公司：嘉善和盛网络有限公司
 * 备注：发布的行程页面
 */
public class ReleaseFragment extends BaseFragment<StrokeBinding>{

    public static ReleaseFragment getInstance(){
        ReleaseFragment relasefragment=null;
        if (relasefragment==null){
            relasefragment=new ReleaseFragment();
        }
        return relasefragment;
    }

    @Override
    protected int getLayoutId() {

        return  R.layout.stroke;
    }

    protected void initView() {}

    @Override
    protected void initEvent() {
        mBinding.selectRelease.setOnClickListener(v -> {
            String token= TokenUtils.getToken();
            if (!CollectionUtils.isNullOrEmpty(token)) {
                startActivityForResult(ReleaseActivity.class,99,null,true);
            }else {
                startActivityForResult(LoginActivity.class,99,null,true);
            }

        });
        mBinding.selectReserve.setOnClickListener(v -> {
            String token= TokenUtils.getToken();
            if (!CollectionUtils.isNullOrEmpty(token)) {
                startActivityForResult(ReserveActivity.class,99,null,true);
            }else {
                startActivityForResult(LoginActivity.class,99,null,true);
            }
        });
    }

    @Override
    protected void loadData(boolean isRefresh) {}

}
